<div class="row">
	<div class="col-lg-offset-2 col-lg-5">
		<%= form_for @task do |f| %>
			<div class="form-group">
				<label class="control-label">Task Name</label>
				<%= f.text_field :name, class: "form-control" %>
				<% if @task.errors[:name].present? %>
                	<div class="error-message"><%=  @task.errors[:name][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				 <label class="control-label">Due Date</label>
				 <%= f.date_select :due_date, class: "form-control", prompt: true%>
				 <% if @task.errors[:due_date].present? %>
                	<div class="error-message"><%=  @task.errors[:due_date][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Owner</label>
				<%= f.collection_select :owner, User.all, :id, :email, {}, class: "form-control" %>
				<% if @task.errors[:owner].present? %>
                	<div class="error-message"><%=  @task.errors[:owner][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Owner</label>
				<%= f.collection_select :task_category_id, TaskCategory.all, :id, :name, {}, class: "form-control" %>
				<% if @task.errors[:task_category_id].present? %>
                	<div class="error-message"><%=  @task.errors[:task_category_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Status</label>
				<%= f.collection_select :task_status_id, TaskStatus.all, :id, :name, {}, class: "form-control" %>
				<% if @task.errors[:task_status_id].present? %>
                	<div class="error-message"><%=  @task.errors[:task_status_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Priority</label>
				<%= f.collection_select :priority_id, Priority.all, :id, :name, {}, class: "form-control" %>
				<% if @task.errors[:priority_id].present? %>
                	<div class="error-message"><%=  @task.errors[:priority_id][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<label class="control-label">Notes</label>
				<%= f.text_area :notes, class: "form-control" %>
				<% if @task.errors[:notes].present? %>
                	<div class="error-message"><%=  @task.errors[:notes][0]%></div>
               	<% end %>
			</div>
			<div class="form-group">
				<%= f.submit "Save", class: "btn btn-warning" %>
				<%= link_to "Back", tasks_path , class: "btn btn-primary" %>
			</div>
		<% end %>
	</div>
</div>